package com.gitee.hermer.engine.jars.dependent.thread.pool.callback;

import java.util.concurrent.atomic.AtomicBoolean;

import com.gitee.hermer.boot.jee.commons.log.UtilsContext;

public abstract class CallableResult<V> extends UtilsContext {
	
	
	private AtomicBoolean isdone = new AtomicBoolean(false);
	
	public boolean isDone(){
		return isdone.get();
	}
	
	public void done(){
		isdone.compareAndSet(false, true);
	}
	
	public abstract void onCall(V value) throws Exception;
	
	public void onError(Throwable e){
		error(e.getMessage(),e);
	}

}
